package com.csst.service.impl;

import java.util.LinkedHashMap;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.csst.bean.Customer;
import com.csst.dao.CustomerDAO;
import com.csst.service.CustomerService;

@Service
public class CustomerServiceBean implements CustomerService {
	private CustomerDAO dao;
	
	public CustomerDAO getDao() {
		return dao;
	}

	@Resource
	public void setDao(CustomerDAO dao) {
		this.dao = dao;
	}

	public List<Customer> list(){
		return dao.getScrollData(-1, -1);
	}
	
	public List<Customer> list1(){
		LinkedHashMap<String, String> hashMap=new LinkedHashMap<String, String>();
		hashMap.put("custName", "asc");
		hashMap.put("custId", "desc");
		return dao.getScrollData(-1, -1,hashMap);
	}

	public void save(Customer customer) {
		dao.save(customer);
	}
}
